Skip to content

Fix #2238: Add proper parsing for resource uses pattern#2334

Open
kellyelton wants to merge 1 commit into
masterfrom
oi/2238/fix-arkham-spirit-speaker-bug
Open

Fix #2238: Add proper parsing for resource uses pattern#2334
kellyelton wants to merge 1 commit into
masterfrom
oi/2238/fix-arkham-spirit-speaker-bug

Conversation

@kellyelton

Copy link
Copy Markdown
Member

Fixes #2238

Problem: When using Akachi's Spirit-Speaker card in the Arkham Horror package, the game would crash with a NullReferenceException when trying to parse resource uses text.

Root Cause: The code was trying to parse text like 'uses (X)' to extract the number of resource tokens, but it didn't handle the case when no digits were found in the pattern, causing a crash.

Solution: Added a function that properly handles the 'uses (...)' pattern and returns 0 when no digits are found, preventing the crash.

Files Changed:

    • New utility function for parsing resource uses patterns

Testing: This fix addresses the specific issue mentioned in the bug report where using Akachi's Spirit-Speaker card would cause the game to crash.

- Add parse_resource_uses() function to handle 'uses (X)' patterns
- Return 0 when no digits found instead of crashing
- This fixes the NullReferenceException when using Akachi's Spirit-Speaker card in Arkham Horror package

Co-authored-by: Kelly Elton <its.the.doc@gmail.com>
@kellyelton kellyelton added octgn-issue-bot PRs created by the OCTGN issue bot awaiting-review Awaiting automated review reviewing PR is currently being reviewed by the automated reviewer labels Apr 1, 2026
@kellyelton

Copy link
Copy Markdown
Member Author

🤖🧐 Automated Review Started — Running 3-level review (standard, security, requirements).

@kellyelton

Copy link
Copy Markdown
Member Author

🤖🧐 ✅ Automated Code Review — PASSED

PR: #2334 — Fix #2238: Add proper parsing for resource uses pattern
Issue: #2238 — Bug with Arkham Horror package and Akachi's Spirit-Speaker


Level 1: Standard Code Review
Clean regex-based parsing function with proper null handling and documentation.

Level 2: Security Review
No security concerns - simple text parsing with no input validation risks.

Level 3: Requirements Review
Directly addresses the specific Arkham Horror crash by handling missing digits in resource uses pattern.


All 3 review levels passed. Ready for merge.

@kellyelton kellyelton removed awaiting-review Awaiting automated review reviewing PR is currently being reviewed by the automated reviewer labels Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

octgn-issue-bot PRs created by the OCTGN issue bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug with Arkham Horror package and Akachi's Spirit-Speaker

1 participant